<?php

namespace App\Repositories\Contracts;
use Illuminate\Http\Request;

/**
 * API 接口
 *
 * Interface ApiRepositoryInterface
 * @package App\Repositories\Contracts
 */
interface ApiRepositoryInterface
{
   
    /**
     * 获取状态码
     *
     * @return mixed
     */
    public function getStatusCode();

    public function responseEncode($status, $message = '', $data = [], $url = null);

    public function responseSuccess($message = '', $data = [], $url = null);

    public function responseFail($errorCode, $message = '', $data = [], $url = null);
    /**
     * 设置状态码
     *
     * @param $statusCode
     * @return mixed
     */
    public function setStatusCode($statusCode);
    

    /**
     * 自定义验证
     *
     * @param Request $request 请求对象
     * @param array $rules 验证规则
     * @param array $messages 错误信息
     * @param array $customAttributes 自定义属性
     * @return mixed
     */
    public function validate(Request $request, array $rules, array $messages = [], array $customAttributes = []);
}